home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / transpor / ifmail23.z / ifmail23 / ifmail / ifcico / answer.c next >
Encoding:
C/C++ Source or Header  |  1994-04-24  |  1.0 KB  |  52 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "lutil.h"
  4. #include "ftn.h"
  5. #include "nodelist.h"
  6. #include "session.h"
  7. #include "config.h"
  8.  
  9. extern int rawport(void);
  10. extern int nolocalport(void);
  11. extern int cookedport(void);
  12. extern void rdoptions(node *);
  13.  
  14. int answer(stype)
  15. char *stype;
  16. {
  17.     int st,rc;
  18.     node *nlent;
  19.  
  20.     if ((nlent=getnlent(NULL)) == NULL)
  21.     {
  22.         logerr("could not get dummy nodelist entry");
  23.         return 1;
  24.     }
  25.  
  26.     rdoptions(nlent);
  27.  
  28.     inbound=norminbound; /* slave session is unsecure by default */
  29.  
  30.     if (stype == NULL)
  31.         st=SESSION_UNKNOWN;
  32.     else if (strcmp(stype,"tsync") == 0)
  33.         st=SESSION_FTSC;
  34.     else if (strcmp(stype,"yoohoo") == 0)
  35.         st=SESSION_YOOHOO;
  36.     else if (strncmp(stype,"**EMSI_",7) == 0)
  37.         st=SESSION_EMSI;
  38.     else
  39.         st=SESSION_UNKNOWN;
  40.     debug(10,"answer to \"%s\" (%d) call",stype?stype:"unknown type",st);
  41.  
  42.     if ((rc=rawport()) != 0)
  43.         logerr("unable to set raw mode");
  44.     else if ((rc=nolocalport()) != 0)
  45.         logerr("unable to set non-local mode");
  46.     else
  47.         rc=session(NULL,NULL,SESSION_SLAVE,st,stype);
  48.  
  49.     cookedport();
  50.     return rc;
  51. }
  52.